package com.atfx.utils;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

/**
 * 属性工具类
 */
public class MyPropertyUtil {

    /**
     * @param pro 文件路径
     * @param key key
     * @return value
     */
    public static String getProperty(String pro, String key) {
        Properties properties = new Properties();

        InputStream resourceAsStream = MyPropertyUtil.class.getClassLoader().getResourceAsStream(pro);
        try{
            properties.load(resourceAsStream);
        } catch (IOException e) {
            e.printStackTrace();
        }
        String property = properties.getProperty(key);
        return property;
    }
}
